import {
    center,
    formInput
} from '@/css/DialogsCss.module.scss';
export default {
    title:'新增编辑',
    dialog:{
        size:'50%'
    },
    onMounted: [{
        action:'print',
        value:'$params'
    },{
        action:'set',
        target: '$view',
        field:'title',
        value:'$params.title'
    },{
        action: 'set',
        target: '$widgets.form',
        field: 'value',
        value: '$params.form'
    }],
    items: [{
        region: 'center',
        class: center,
        layout: 'vertical',
        items: [{
            layout: 'vertical',
            items: [{
                id: 'form',
                widget: 'form',
                layout: {
                    type:'gridform',
                    column: 2
                },
                fields:[{
                    class: formInput,
                    itemId: 'operator_uuid',
                    placeholder:'请选择创建人',
                    widget:'select',
                    dictionary: 'common/dictionary/user',
                    label:'创建人',
                },{
                    class: formInput,
                    itemId: 'full_name',
                    placeholder:'请输入姓名',
                    widget:'text',
                    label:'姓名',
                },{
                    class: formInput,
                    itemId: 'family_name',
                    placeholder:'请输入姓',
                    widget:'text',
                    label:'姓',
                },{
                    class: formInput,
                    itemId: 'middle_name',
                    placeholder:'请输入中间名',
                    widget:'text',
                    label:'中间名',
                },{
                    class: formInput,
                    itemId: 'given_name',
                    placeholder:'请输入名',
                    widget:'text',
                    label:'名',
                },{
                    class: formInput,
                    itemId: 'nick_name',
                    placeholder:'请输入昵称',
                    widget:'text',
                    label:'昵称',
                },{
                    class: formInput,
                    itemId: 'birthday',
                    placeholder:'请选择出生日期',
                    widget:'form-datepicker',
                    type: 'date',
                    label:'出生日期',
                },{
                    class: formInput,
                    itemId: 'company',
                    placeholder:'请选择公司',
                    widget:'select',
                    dictionary: 'common/dictionary/customer',
                    label:'公司',
                },{
                    class: formInput,
                    itemId:'department',
                    placeholder:'请选择部门',
                    widget:'select',
                    dictionary: 'common/dictionary/organization',
                    label:'部门',
                },{
                    class: formInput,
                    itemId:'title',
                    placeholder:'请选择职位',
                    widget:'select',
                    dictionary: {
                        path: 'system/dictionary/config/list',
                        params: {
                            name: 'organization_position',
                        },
                    },
                    label:'职位',
                },{
                    class: formInput,
                    itemId: 'primary_tel',
                    placeholder:'请输入手机号码',
                    widget:'text',
                    label:'手机号码',
                },{
                    class: formInput,
                    itemId: 'primary_mail',
                    placeholder:'请输入邮箱地址',
                    widget:'text',
                    label:'邮箱地址',
                },{
                    class: formInput,
                    itemId:'is_shared',
                    placeholder:'请选择是否共享',
                    widget:'select',
                    dictionary: 'common/static/shared',
                    label:'是否共享',
                },{
                    class: formInput,
                    itemId: 'remarks',
                    placeholder:'请输入备注信息',
                    widget:'text',
                    label:'备注信息',
                }],
                buttons: [{
                    value: '保存',
                    type: 'primary',
                    onClick: [{
                        action: 'confirm',
                        title: '表单保存',
                        message: '是否保存表单?',
                        confirm: [{
                            var:'value',
                            target:'$widget',
                            action:'call',
                            method:'getValue'
                        },{
                            action: 'service',
                            path: 'contact/personal/save',
                            params: {
                                organization_uuid: '$params.organization_uuid',
                                 '...':['$vars.value']
                             }
                        },{
                            action:'dialog-hide',
                            mode:'apply'
                        }]
                    }]
                }],
                flex: true
            }]
        }]
    }]
};


